Haskell Beats C Using Generalized Stream Fusion

نویسندگان

  • Geoffrey Mainland
  • Roman Leshchinskiy
  • Simon Peyton Jones
چکیده

Stream fusion [6] is a powerful technique for automatically transforming high-level sequence-processing functions into efficient implementations. It has been used to great effect in Haskell libraries for manipulating byte arrays, Unicode text, and unboxed vectors. However, some operations, like vector append, still do not perform well within the standard stream fusion framework. Others, like SIMD computation using the SSE and AVX instructions available on modern x86 chips, do not seem to fit in the framework at all. In this paper we introduce generalized stream fusion, which solves these issues. The key insight is to bundle together multiple stream representations, each tuned for a particular class of stream consumer. We also describe a stream representation suited for efficient computation with SSE instructions. Our ideas are implemented in modified versions of the GHC compiler and vector library. Benchmarks show that high-level Haskell code written using our compiler and libraries can produce code that is faster than both compilerand hand-vectorized C.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Stream Fusion on Haskell Unicode Strings

Prior papers have presented a fusion framework called stream fusion for removing intermediate data structures from both lists and arrays in Haskell. Stream fusion is unique in using an explicit datatype to accomplish fusion. We demonstrate how this can be exploited in the creation of a new Haskell string representation Text, which achieves better performance and data density than String . Text ...

متن کامل

Stream Fusion

Stream Fusion [1] is a system for removing intermediate list structures from Haskell programs; it consists of a Haskell library along with several compiler rewrite rules. (The library is available online at http://www.cse.unsw.edu.au/∼dons/streams.html.) These theories contain a formalization of much of the Stream Fusion library in HOLCF. Lazy list and stream types are defined, along with coerc...

متن کامل

Outsourcing the Graphical Input/Output using Streams and Haskell

This paper presents a generalized system for graphical IO that views the graphical environment as a separate IO device, for Haskell and other functional languages. Haskell uses monads in its IO system but these are considered difficult and stimulate an imperative way of thinking. This paper shows why an implementation of the so-called stream model provides a solution to these problems. We demon...

متن کامل

Predicting Generalized Anxiety Disorder Based on Emotion Regulation Deficits, Thought-Action Fusion, and Behavioral Inhibition

Background & Aims: Generalized anxiety disorder (GAD) can be affected by different emotional, cognitive, and natural factors. The purpose of this study was to predict GAD based on emotion regulation deficits, thought-action fusion, and behavioral inhibition. Methods: This was a correlational study. The study sample was comprised of 135 patients with GAD selected from amo...

متن کامل

Uncertainty Measurement for Ultrasonic Sensor Fusion Using Generalized Aggregated Uncertainty Measure 1

In this paper, target differentiation based on pattern of data which are obtained by a set of two ultrasonic sensors is considered. A neural network based target classifier is applied to these data to categorize the data of each sensor. Then the results are fused together by Dempster–Shafer theory (DST) and Dezert–Smarandache theory (DSmT) to make final decision. The Generalized Aggregated Unce...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2013